package user;
import Operation.*;
import book.BookList;
import java.util.Scanner;

public class NormalUser extends User{

    public NormalUser(String name) {
        super(name);
        this.iOperations = new IOperation[]{
                new ExitOperation(),
                new BorrowOperation(),
                new ReturnOperation(),
                new FindOperation(),
                new ShowOperation()
        };
    }

    public int menu() {
        System.out.println("******普通用户******");
        System.out.println("1. 借阅图书");
        System.out.println("2. 归还图书");
        System.out.println("3. 查找图书");
        System.out.println("4. 查看所有图书");
        System.out.println("0. 退出系统");

        System.out.println("请选择你的操作：");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;
    }

    public void doOperation(int choice, BookList bookList) {
        this.iOperations[choice].work(bookList);
    }
}
